<template>
  <van-search
    v-model="value"
    show-action
    shape="round"
    placeholder="请输入搜索关键词"
    @search="onSearch"
  >
    <template #action>
      <div @click="onClickButton">搜索</div>
    </template>
  </van-search>
</template>

<script setup>
  import { ref } from 'vue'
  const value = ref('')

  const onSearch = () => {
    console.log(value.value)
  }
  
  const onClickButton = () => {
    onSearch()
  }
</script>